package com.jxwifi.cloud.quickclean.adapter;

import android.graphics.Color;
import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.jxwifi.cloud.quickclean.R;
import com.jxwifi.cloud.quickclean.bean.MyCleanersBean;
import com.jxwifi.cloud.quickclean.bean.OptRecordsBean;

import java.util.List;

public class OrderStartsAdapter extends BaseQuickAdapter<OptRecordsBean, BaseViewHolder> {

    private String mCreateTime;

    public OrderStartsAdapter(@LayoutRes int layoutResId, @Nullable List data,String mCreateTime) {
        super(layoutResId, data);
        this.mCreateTime=mCreateTime;
    }

    @Override
    protected void convert(BaseViewHolder helper, OptRecordsBean item) {

        //背景色 shap_card_roll_title_un
        //颜色：#D7D7D7
        if (mCreateTime.equals(item.getCreateTime())) {
            helper.getView(R.id.img_order_details_ball).setBackgroundResource(R.drawable.shap_card_roll_title);
            helper.getView(R.id.vw_order_starts).setBackgroundResource(R.color.color_text5);
            helper.setTextColor(R.id.tv_order_details_process, Color.parseColor("#3DB64D")).setText(R.id.tv_order_details_process, item.getContent());
        } else {
            helper.getView(R.id.img_order_details_ball).setBackgroundResource(R.drawable.shap_card_roll_title_un);
            helper.getView(R.id.vw_order_starts).setBackgroundResource(R.color.c_k2_d7d7d7);
            helper.setTextColor(R.id.tv_order_details_process, Color.parseColor("#999999")).setText(R.id.tv_order_details_process, item.getContent());
        }
        helper.setText(R.id.tv_order_details_time_items, item.getCreateTime());
    }
}
